import request from '@/router/axios';
import { data } from 'jquery';

export const getList = (current, size, params) => {
  return request({
    url: `/api/mes-warehouse/purchase-order/page`,
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getDetail = (id) => {
  return request({
    url: '/api/mes-warehouse/purchase-order/detail-by-id',
    method: 'get',
    params: {
      id: id
    }
  });
};

export const remove = (ids) => {
  return request({
    url: '/api/mes-warehouse/purchase-order/remove',
    method: 'post',
    params: {
      ids
    }
  });
};

export const add = (row) => {
  return request({
    url: '/api/mes-warehouse/purchase-order/submit-list',
    method: 'post',
    data: row
  });
};

export const update = (row) => {
  return request({
    url: '/api/mes-warehouse/purchase-order/submit-list',
    method: 'post',
    data: row
  });
};


export const getDetailList = (current, size, params) => {
  return request({
    url: '/api/mes-warehouse/purchase/order/detail/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};
